package com.shinechain.utils;

import com.shinechain.dao.RewardMapper;
import com.shinechain.dao.RewardUserMapper;
import com.shinechain.model.Reward;
import com.shinechain.model.RewardUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

@Service(value = "rewardUtil")
public class RewardUtil {
    @Autowired
    RewardMapper rewardMapper;

    @Autowired
    RewardUserMapper rewardUserMapper;

    public static HashMap<String,Reward> hashMap = new HashMap<>();

    public static HashMap<String,HashMap<String,RewardUser>> userMap = new HashMap<>();

    public static HashMap<String,List<Double>> redPacketMap = new HashMap<>();

    public static HashMap<String,Integer> timesMap = new HashMap<String, Integer>();

    public void getReward(){

    }

    public void insetReward(Reward reward){
        rewardMapper.insert(reward);
        RewardUtil.hashMap.put(reward.getToken(),reward);
    }
}
